import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * @USER: Administrator
 * @DATE: 2024/9/15 上午10:28
 * @VERSION: 1.0.0
 */
public class LC1207 {
    public static void main(String[] args) {

    }
    public boolean uniqueOccurrences(int[] arr) {
        Map<Integer, Integer> map = new HashMap<>();
        for (int j : arr) {
            map.put(j, map.getOrDefault(j, 0) + 1);
        }

        Set<Object> set = new HashSet<>();
        for (Integer integer : map.keySet()) {
            if (!set.add(map.get(integer))){
                return false;
            }
        }
        return true;
    }
}
